package com.shiwaixiangcun.customer.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 用户修改头像Bean
 *
 * @author Administrator
 * @date 2017/11/22
 */

public class AvatarBean implements Parcelable {

    public static final Parcelable.Creator<AvatarBean> CREATOR = new Parcelable.Creator<AvatarBean>() {
        @Override
        public AvatarBean createFromParcel(Parcel source) {
            return new AvatarBean(source);
        }

        @Override
        public AvatarBean[] newArray(int size) {
            return new AvatarBean[size];
        }
    };
    /**
     * data : {"avatar":"http://resource.shiwaixiangcun.cn/group1/M00/01/0E/rBKx51oU9QWAZoBkAACWrn1esBs717.jpg"}
     * message : 操作成功
     * responseCode : 1001
     * success : true
     */

    private DataBean data;
    private String message;
    private int responseCode;
    private boolean success;

    public AvatarBean() {
    }

    protected AvatarBean(Parcel in) {
        this.data = in.readParcelable(DataBean.class.getClassLoader());
        this.message = in.readString();
        this.responseCode = in.readInt();
        this.success = in.readByte() != 0;
    }

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getResponseCode() {
        return responseCode;
    }

    public void setResponseCode(int responseCode) {
        this.responseCode = responseCode;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.data, flags);
        dest.writeString(this.message);
        dest.writeInt(this.responseCode);
        dest.writeByte(this.success ? (byte) 1 : (byte) 0);
    }

    public static class DataBean implements Parcelable {
        public static final Parcelable.Creator<DataBean> CREATOR = new Parcelable.Creator<DataBean>() {
            @Override
            public DataBean createFromParcel(Parcel source) {
                return new DataBean(source);
            }

            @Override
            public DataBean[] newArray(int size) {
                return new DataBean[size];
            }
        };
        /**
         * avatar : http://resource.shiwaixiangcun.cn/group1/M00/01/0E/rBKx51oU9QWAZoBkAACWrn1esBs717.jpg
         */

        private String avatar;

        public DataBean() {
        }

        protected DataBean(Parcel in) {
            this.avatar = in.readString();
        }

        public String getAvatar() {
            return avatar;
        }

        public void setAvatar(String avatar) {
            this.avatar = avatar;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.avatar);
        }
    }
}
